package com.control.back.halo.function.controller;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.control.back.halo.basic.controller.BaseController;
import com.control.back.halo.function.entity.Calendar;
import com.control.back.halo.function.service.ICalendarService;

@Controller
@RequestMapping("/calendar")
public class CalendarController extends BaseController {
    
    @Autowired
    private ICalendarService calendarService;

    @RequestMapping({ "", "index" })
    public String index(Model model) {
        return "calendar/index";
    }

    @RequestMapping("/saveOrUpdate")
    @ResponseBody
    public ResponseEntity<String> saveOrUpdate(Calendar calendar) {
        return ResponseEntity.ok().body("保存成功");
    }

    @RequestMapping("/loadEvents")
    @ResponseBody
    public ResponseEntity<List<Calendar>> loadEvents(Date date) {
        
//        calendarService.findAll(spec);
        return null;
    }
}
